<script setup lang='ts'>
import { ref } from 'vue'
import { useAppStore } from "@/store/modules/app"
import { Menu as Location } from '@element-plus/icons-vue'
//侧边栏是否折叠
const appStore = useAppStore()

const handleOpen = (key: string, keyPath: string[]) => {
    console.log(key, keyPath)
}
const handleClose = (key: string, keyPath: string[]) => {
    console.log(key, keyPath)
}
const handleSelect = (key: string, keyPath: string[]) => {
    console.log(key, keyPath)
}
</script>

<template>
    <el-menu background-color="#001535" text-color="#fff" default-active="2" class="el-menu-vertical-demo"
        :collapse="appStore.sidebar.opened" @open="handleOpen" @close="handleClose" @select="handleSelect">
        <el-sub-menu index="1">
            <template #title>
                <el-icon>
                    <location />
                </el-icon>
                <span>医生工作站</span>
            </template>
            <el-menu-item index="1-1">问诊</el-menu-item>
            <el-menu-item index="1-2">患者列表</el-menu-item>
            <!-- <el-sub-menu index="1-4">
                <template #title><span>患者</span></template>
                <el-menu-item index="1-4-2">患者列表</el-menu-item>
            </el-sub-menu> -->
        </el-sub-menu>
        <el-sub-menu index="1">
            <template #title>
                <el-icon>
                    <location />
                </el-icon>
                <span>医生工作站</span>
            </template>
            <el-menu-item index="1-1">问诊</el-menu-item>
            <el-menu-item index="1-2">患者列表</el-menu-item>
            <!-- <el-sub-menu index="1-4">
                <template #title><span>患者</span></template>
                <el-menu-item index="1-4-2">患者列表</el-menu-item>
            </el-sub-menu> -->
        </el-sub-menu>
    </el-menu>
</template>

<style lang='scss' scoped>
.el-menu-vertical-demo:not(.el-menu--collapse) {
    width: 200px;
    min-height: 400px;
}
</style>
